<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Student Grades</title>
<link href="${pageContext.request.contextPath}/static/css/jquery.dataTables.css" rel="stylesheet"/>
	<script src="${pageContext.request.contextPath}/static/js/jquery.dataTables.js"></script>
<% String name = (String)request.getSession().getAttribute("userName"); %>
<script>
$(function() {
	$('#inlineEditDataTable').DataTable({
		lengthMenu: [
		             [ 5, 10, 15, -1 ],
		             [ '5 rows', '10 rows', '15 rows', 'Show all' ]
		         ],
	          'language': {  
	                'emptyTable': '没有数据',  
	                'loadingRecords': '加载中...',  
	                'processing': '查询中...',  
	                'search': '查询:',  
	                'lengthMenu': '每页 _MENU_ 条',  
	                'zeroRecords': '没有数据',  
	                'paginate': {  
	                    'first':      '第一页',  
	                    'last':       '最后一页',  
	                    'next':       '',  
	                    'previous':   ''  
	                },  
	                'info': '第 _PAGE_ 页 / 总 _PAGES_ 页',  
	                'infoEmpty': '没有数据',  
	                'infoFiltered': '(过滤总件数 _MAX_ 条)'  
	            },
	        "aoColumnDefs": [
	          { 'bSortable': false, 'aTargets': [ "no-sort" ] }
	        ],
	        "fnInitComplete": function(oSettings, json) { 
	          $('.dataTables_filter input').attr("placeholder", "Search");
	        }

	});
});
</script>
<script>
function Print() {
    var tit = document.title;
    document.title = "";
    table1.style.display = "none";
    window.print();
    document.title = tit;
    table1.style.display = ""; 
}
</script>
</head>
<body>
	<table class="table table-hover table-striped table-bordered" 
			cellSpacing="0" cellPadding="0" id="inlineEditDataTable">
			<thead>
		<tr style="text-align: center;" class="info">
			<td>姓名</td>
			<td>学号</td>	
			<td>考试科目编号</td>	
			<td>科目名称</td>	
			<td>参加考试时间</td>	
			<td>总分</td>		
		</tr>
		</thead>
		<tbody>
		<c:forEach items="${stuGradeList }" var="stuGradeList">
			<tr>
				<td>${stuGradeList.examName }</td>
				<td>${stuGradeList.examNumber}</td>
				<td>${stuGradeList.examSubjectId }</td>
				<td>${stuGradeList.examSubjectName }</td>
				<td><fmt:formatDate value="${stuGradeList.upddate }" pattern="yyyy-MM-dd"/></td>
				<td>${stuGradeList.examGradePoint }</td>
			</tr>
		</c:forEach>
		</tbody>
		 <tr>
		 	<td colspan="6" class="success">
		 		<input id="table1" type="button" value="打印" class="btn btn-info btn-xm" onclick="Print()">
		 	</td>
		 </tr>
	</table>
</body>
</html>